import jieba
import wordcloud as wc
import imageio
mask = imageio.imread("fivestar.png")
# f = open("关于实施乡村振兴战略的意见.txt", "r", encoding="utf-8")
f = open("新时代中国特色社会主义.txt", "r", encoding="utf-8")
t = f.read()
f.close()
ls = jieba.lcut(t)
txt = " ".join(ls)
w = wc.WordCloud(font_path="msyh.ttc", width=1000, height=700,
                 background_color="white", stopwords="和 的 是 在",
                 mask=mask)
w.generate(txt)
w.to_file("新时代5星.png")